#ifndef BERNOULLIDIRECTNODE_H
#define BERNOULLIDIRECTNODE_H

#include "node.h"

class BernoulliDirectNode : public Node
{
private:

    // key is binary representation of state of parent nodes:
    // for instance, if this node has three parent nodes with states
    // T, T, and F, then key is binary value 110 or 6
    QMap<int, double> parentDistributions;

    int pNode;
    bool holdConstant;
    double tmp;

    virtual bool inRange(double v);

public:


    BernoulliDirectNode(QString label, double val, double sd, Node * parent, bool holdConstant = false, bool isObserved = false);
    BernoulliDirectNode(QString label, double val, double sd, bool holdConstant = false, bool isObserved = false);

    void setStateDistribution(int state, double distribution);
    virtual double generateSample();
    virtual double computeLogLikelihood();
};

#endif // BERNOULLIDIRECTNODE_H
